import { dateFormat } from '@/util/date';
export const startDate = dateFormat(new Date(), 'yyyy-MM-') + '01';
let now = new Date();
now.setDate(now.getDate() + 1);
export const endDate = dateFormat(now, 'yyyy-MM-dd');
export const tableOption = {
  border: true,
  index: true,
  indexLabel: '序号',
  stripe: true,
  menuAlign: 'center',
  align: 'center',
  dialogWidth: '70%',
  printBtn: false,
  showClomnuBtn: false,
  searchSize: 'mini',
  editBtnText: '销毁',
  addBtn: false,
  editBtn: false,
  viewBtn: false,
  delBtn: false,
  arrow: false,
  column: [{
      label: '标识',
      prop: 'id',
      hide: true,
      display: false,
    }, {
      label: '出库单号',
      prop: 'outputStockno',
      search: true,
      display: false,
      editDisabled: true
    }, {
      label: '票种',
      prop: 'destroyCardType',
      type: 'select',
      search: true,
      dicUrl: '/support/swpmticketcardtype/dict',
      props: {
        label: 'mainName',
        value: 'mainEnName'
      },
      cascaderItem: ["ticketName"],
      rules: [{
        required: true,
        message: '请选择清销毁票种',
        trigger: 'blur'
      }],
      display: false,
    }, {
      label: '车票名称',
      prop: 'ticketName',
      type: 'select',
      search: true,
      props: {
        label: 'subName',
        value: 'subEnName'
      },
      dicUrl: '/support/swpmticketcardtypeparam/dictAll/{{key}}',
      dicFlag: false,
      rules: [{
        required: true,
        message: '请选择车票名称',
        trigger: 'blur'
      }],
      display: false,
    },
    {
      "type": "date",
      "label": "销毁时间",
      "prop": "destroyTimeDTO",
      "search": true,
      format: 'yyyy-MM-dd',
      valueFormat: 'yyyy-MM-dd',
      hide: true,
      display: false
    },
    {
      "type": "date",
      "label": "出库时间",
      "prop": "outStorageTimeDTO",
      "search": true,
      format: 'yyyy-MM-dd',
      valueFormat: 'yyyy-MM-dd',
      hide: true,
      display: false,
      searchValue: [startDate, endDate],
      searchRange: true,
      searchSpan: 12
    },
    {
      label: '车票次数',
      prop: 'ticketTimes',
      rules: [{
        message: '请输入车票次数',
        trigger: 'blur'
      }],
      display: false,
    }, {
      label: '金额',
      prop: 'ticketPrice',
      type: 'number',
      precision: 2,
      rules: [{
        message: '请输入车票金额',
        trigger: 'blur'
      }],
      display: false,
    }, {
      label: '车票数量(张)',
      prop: 'destroyNumber',
      type: 'number',
      precision: 0,
      rules: [{
        required: true,
        message: '请输入销毁数量',
        trigger: 'blur'
      }],
      display: false,
    }, {
      label: '库区分区',
      prop: 'stockArea',
      type: 'select',
      dicUrl: '/support/swpmticketarea/dict',
      props: {
        label: "ticketAreaName",
        value: "id"
      },
      rules: [{
        required: true,
        message: '请选择库区分区',
        trigger: 'blur'
      }],
      display: false,
    }, {
      label: '车票有效期',
      prop: 'activeTime',
      type: 'number',
      precision: 0,
      rules: [{
        required: true,
        message: '请输入车票有效期',
        trigger: 'blur'
      }],
      display: false,
    }, {
      label: '车票最晚启动日期',
      prop: 'latestStartTime',
      type: 'date',
      format: 'yyyy-MM-dd',
      valueFormat: 'yyyy-MM-dd HH:mm:ss',
      rules: [{
        message: '请输入车票最晚启动日期',
        trigger: 'blur'
      }],
      display: false,
    }, {
      label: '票卡卡号',
      prop: 'ticketNo',
      type: 'textarea',
      maxRows: 6,
      minRows: 4,
      span: 24,
      display: false,
    }, {
      "type": "datetime",
      "label": "出库时间",
      "prop": "outStorageTime",
      format: 'yyyy-MM-dd HH:mm:ss',
      valueFormat: 'yyyy-MM-dd HH:mm:ss',
      display: false
    }, {
      "type": "upload",
      "label": "附件",
      "prop": "file",
      component: "zd-upload",
      dataType: 'string',
      limit: 1,
      hide: true,
      display: false,
    }, {
      "type": "upload",
      "label": "图片",
      "prop": "picture",
      listType: 'picture-img',
      component: "zd-upload",
      hide: true,
      display: false,
    }, {
      label: '销毁人',
      prop: 'destroyer',
      type: 'select',
      component: 'user-select',
      params: {
        userCodeKye: 'destroyerId'
      },
      rules: [{
        required: true,
        message: '请选择销毁人',
        trigger: 'blur'
      }],
      display: false,
    }, {
      label: '销毁人工号',
      prop: 'destroyerId',
      disabled: true,
      placeholder: ' ',
      display: false,
    }, {
      "type": "datetime",
      "label": "销毁时间",
      "prop": "destroyTime",
      format: 'yyyy-MM-dd HH:mm:ss',
      valueFormat: 'yyyy-MM-dd HH:mm:ss',
      display: false,
    }, {
      label: '备注',
      prop: 'remark',
      type: 'textarea',
      maxRows: 6,
      minRows: 4,
      display: false,
    }, {
      label: '创建人ID',
      prop: 'creatorId',
      hide: true,
      display: false,
    }, {
      label: '创建人名称',
      prop: 'creatorName',
      hide: true,
      display: false,
    }, {
      label: '创建时间',
      prop: 'createtime',
      hide: true,
      display: false,
    }
  ],
  group: [{
    label: '销毁出库信息摘要',
    prop: 'ckxx',
    icon: 'el-icon-edit-outline',
    arrow: false,
    column: [{
        "type": "input",
        "label": "销毁单号",
        "prop": "outputStockno",
        detail: true,
      },
      {
        "type": "datetime",
        "label": "出库时间",
        "prop": "outStorageTime",
        format: 'yyyy-MM-dd HH:mm:ss',
        valueFormat: 'yyyy-MM-dd HH:mm:ss',
        detail: true,
      },
    ]
  }, {
    label: '销毁出库明细',
    prop: 'ckmx',
    icon: 'el-icon-edit-outline',
    arrow: false,
    column: [{
      "type": "select",
      "label": "票种",
      "prop": "destroyCardType",
      dicUrl: '/support/swpmticketcardtype/dict',
      props: {
        label: 'mainName',
        value: 'mainEnName'
      },
      cascaderItem: ["ticketName"],
      editDetail: true,
    }, {
      "type": "select",
      "label": "车票名称",
      "prop": "ticketName",
      dicFlag: false,
      props: {
        label: 'subName',
        value: 'subEnName'
      },
      component: 'ticket-name-select',
      params: {
        ticketAmountKey: 'ticketPrice',
        ticketCountKey: 'ticketTimes'
      },
      dicUrl: '/support/swpmticketcardtypeparam/dictAll/{{key}}',
      editDetail: true,
    }, {
      "type": "number",
      "label": "车票次数",
      "prop": "ticketTimes",
      detail: true,
    }, {
      "type": "number",
      "label": "车票金额",
      "prop": "ticketPrice",
      precision: 2,
      detail: true,
    }, {
      "type": "input",
      "label": "数量",
      "prop": "destroyNumber",
      detail: true,
    }, {
      "type": "select",
      "label": "库存分区",
      "prop": "stockArea",
      dicUrl: '/support/swpmticketarea/dict',
      props: {
        label: "ticketAreaName",
        value: "id"
      },
      detail: true,
    }, {
      "type": "input",
      "label": "车票有效期",
      "prop": "activeTime",
      detail: true,
    }, {
      "type": "date",
      "label": "车票最晚启动日期",
      "prop": "latestStartTime",
      format: 'yyyy-MM-dd',
      valueFormat: 'yyyy-MM-dd HH:mm:ss',
      detail: true,
    }, {
      "type": "textarea",
      "label": "票卡卡号",
      "prop": "ticketNo",
      span: 24,
      detail: true,
    }, {
      dataType: 'string',
      "type": "upload",
      "label": "附件",
      "prop": "file",
      component: "zd-upload",
      limit: 1,
      hide: true,
    }, {
      "type": "upload",
      "label": "图片",
      "prop": "picture",
      listType: 'picture-img',
      component: "zd-upload",
      hide: true,
    }, ]
  }, {
    label: '销毁信息',
    prop: 'lyxx',
    icon: 'el-icon-edit-outline',
    arrow: false,
    column: [{
      "type": "select",
      "label": "销毁人",
      "prop": "destroyer",
      search: true,
      component: 'user-select',
      params: {
        userCodeKey: 'destroyerId'
      },
    }, {
      "type": "input",
      "label": "销毁人工号",
      "prop": "destroyerId",
      detail: true,
    }, {
      "type": "datetime",
      "label": "销毁时间",
      "prop": "destroyTime",
      format: 'yyyy-MM-dd HH:mm:ss',
      valueFormat: 'yyyy-MM-dd HH:mm:ss',
    }, {
      "type": "textarea",
      "label": "备注",
      "prop": "remark",
      span: 24,
    }, ]
  }, ]
}

export const tableOptionXiaoHui = {
  border: true,
  index: true,
  indexLabel: '序号',
  stripe: true,
  menuAlign: 'center',
  align: 'center',
  dialogWidth: '70%',
  refreshBtn: false,
  showClomnuBtn: false,
  emptyBtn: false,
  searchSize: 'mini',
  editBtnText: '销毁',
  viewBtn: true,
  arrow: false,
  submitBtn: false,
  empthBtn: false,
  column: [{
    label: '标识',
    prop: 'id',
    hide: true,
    display: false,
  }, {
    label: '出库单号',
    prop: 'outputStockno',
    search: true,
    display: false,
    editDisabled: true
  }, {
    label: '票种',
    prop: 'destroyCardType',
    type: 'select',
    search: true,
    dicUrl: '/support/swpmticketcardtype/dict',
    props: {
      label: 'mainName',
      value: 'mainEnName'
    },
    cascaderItem: ["ticketName"],
    rules: [{
      required: true,
      message: '请选择清销毁票种',
      trigger: 'blur'
    }],
    display: false,
  }, {
    label: '车票名称',
    prop: 'ticketName',
    type: 'select',
    search: true,
    props: {
      label: 'subName',
      value: 'subEnName'
    },
    dicUrl: '/support/swpmticketcardtypeparam/dictAll/{{key}}',
    dicFlag: false,
    rules: [{
      required: true,
      message: '请选择车票名称',
      trigger: 'blur'
    }],
    display: false,
  }, {
    label: '车票次数',
    prop: 'ticketTimes',
    rules: [{
      message: '请输入车票次数',
      trigger: 'blur'
    }],
    display: false,
  }, {
    label: '金额',
    prop: 'ticketPrice',
    type: 'number',
    precision: 2,
    rules: [{
      message: '请输入车票金额',
      trigger: 'blur'
    }],
    display: false,
  }, {
    label: '车票数量(张)',
    prop: 'destroyNumber',
    type: 'number',
    precision: 0,
    rules: [{
      required: true,
      message: '请输入销毁数量',
      trigger: 'blur'
    }],
    display: false,
  }, {
    label: '库区分区',
    prop: 'stockArea',
    type: 'select',
    dicUrl: '/support/swpmticketarea/dict',
    props: {
      label: "ticketAreaName",
      value: "id"
    },
    rules: [{
      required: true,
      message: '请选择库区分区',
      trigger: 'blur'
    }],
    display: false,
  }, {
    label: '车票有效期',
    prop: 'activeTime',
    type: 'number',
    precision: 0,
    rules: [{
      required: true,
      message: '请输入车票有效期',
      trigger: 'blur'
    }],
    display: false,
  }, {
    label: '车票最晚启动日期',
    prop: 'latestStartTime',
    type: 'datetime',
    valueFormat: 'yyyy-MM-dd HH:mm:ss',
    rules: [{
      message: '请输入车票最晚启动日期',
      trigger: 'blur'
    }],
    display: false,
  }, {
    label: '票卡卡号',
    prop: 'ticketNo',
    type: 'textarea',
    maxRows: 6,
    minRows: 4,
    span: 24,
    display: false,
  }, {
    "type": "upload",
    "label": "附件",
    "prop": "file",
    component: "zd-upload",
    dataType: 'string',
    limit: 1,
    hide: true,
    display: false,
  }, {
    "type": "upload",
    "label": "图片",
    "prop": "picture",
    listType: 'picture-img',
    component: "zd-upload",
    hide: true,
    display: false,
  }, {
    label: '销毁人',
    prop: 'destroyer',
    type: 'select',
    component: 'user-select',
    params: {
      userCodeKye: 'destroyerId'
    },
    rules: [{
      required: true,
      message: '请选择销毁人',
      trigger: 'blur'
    }],
    display: false,
  }, {
    label: '销毁人工号',
    prop: 'destroyerId',
    disabled: true,
    placeholder: ' ',
    display: false,
  }, {
    "type": "datetime",
    "label": "领用时间",
    "prop": "destroyTime",
    format: 'yyyy-MM-dd HH:mm:ss',
    valueFormat: 'yyyy-MM-dd HH:mm:ss',
    display: false,
  }, {
    label: '备注',
    prop: 'remark',
    type: 'textarea',
    maxRows: 6,
    minRows: 4,
    display: false,
  }, {
    label: '创建人ID',
    prop: 'creatorId',
    hide: true,
    display: false,
  }, {
    label: '创建人名称',
    prop: 'creatorName',
    hide: true,
    display: false,
  }, {
    label: '创建时间',
    prop: 'createtime',
    hide: true,
    display: false,
  }],
  group: [{
    label: '销毁出库信息摘要',
    prop: 'ckxx',
    icon: 'el-icon-edit-outline',
    arrow: false,
    column: [{
      "type": "input",
      "label": "销毁单号",
      "prop": "outputStockno",
      detail: true,
      disabled: true,
    }, {
      "type": "datetime",
      "label": "出库时间",
      "prop": "outStorageTime",
      format: 'yyyy-MM-dd HH:mm:ss',
      valueFormat: 'yyyy-MM-dd HH:mm:ss',
      detail: true,
      disabled: true,
    }, ]
  }, {
    label: '销毁出库明细',
    prop: 'ckmx',
    icon: 'el-icon-edit-outline',
    arrow: false,
    column: [{
      "type": "select",
      "label": "票种",
      "prop": "destroyCardType",
      dicUrl: '/support/swpmticketcardtype/dict',
      props: {
        label: 'mainName',
        value: 'mainEnName'
      },
      cascaderItem: ["ticketName"],
      detail: true,
      disabled: true,
    }, {
      "type": "select",
      "label": "车票名称",
      "prop": "ticketName",
      dicFlag: false,
      props: {
        label: 'subName',
        value: 'subEnName'
      },
      component: 'ticket-name-select',
      params: {
        ticketAmountKey: 'ticketPrice',
        ticketCountKey: 'ticketTimes'
      },
      dicUrl: '/support/swpmticketcardtypeparam/dictAll/{{key}}',
      detail: true,
      disabled: true,
    }, {
      "type": "number",
      "label": "车票次数",
      "prop": "ticketTimes",
      detail: true,
      disabled: true,
    }, {
      "type": "number",
      "label": "车票金额",
      "prop": "ticketPrice",
      precision: 2,
      detail: true,
      disabled: true,
    }, {
      "type": "input",
      "label": "数量",
      "prop": "destroyNumber",
      detail: true,
      disabled: true,
    }, {
      "type": "select",
      "label": "库存分区",
      "prop": "stockArea",
      dicUrl: '/support/swpmticketarea/dict',
      props: {
        label: "ticketAreaName",
        value: "id"
      },
      detail: true,
      disabled: true,
    }, {
      "type": "input",
      "label": "车票有效期",
      "prop": "activeTime",
      detail: true,
      disabled: true,
    }, {
      "type": "datetime",
      "label": "车票最晚启动日期",
      "prop": "latestStartTime",
      format: 'yyyy-MM-dd HH:mm:ss',
      valueFormat: 'yyyy-MM-dd HH:mm:ss',
      detail: true,
      disabled: true,
    }, {
      "type": "textarea",
      "label": "票卡卡号",
      "prop": "ticketNo",
      span: 24,
      detail: true,
      disabled: true,
    }, {
      dataType: 'string',
      "type": "upload",
      "label": "附件",
      "prop": "file",
      component: "zd-upload",
      limit: 1,
      detail: true,
    }, {
      "type": "upload",
      "label": "图片",
      "prop": "picture",
      listType: 'picture-img',
      component: "zd-upload",
      detail: true,
    }, ]
  }, {
    label: '销毁信息',
    prop: 'lyxx',
    icon: 'el-icon-edit-outline',
    arrow: false,
    column: [{
      "type": "select",
      "label": "销毁人",
      "prop": "destroyer",
      search: true,
      component: 'user-select',
      params: {
        userCodeKey: 'destroyerId'
      },
      rules: [{
        required: true, message: '请选择销毁人'
      }]
    }, {
      "type": "input",
      "label": "销毁人工号",
      "prop": "destroyerId",
      detail: true,
      disabled: true,
    }, {
      "type": "datetime",
      "label": "销毁时间",
      "prop": "destroyTime",
      format: 'yyyy-MM-dd HH:mm:ss',
      valueFormat: 'yyyy-MM-dd HH:mm:ss',
      rules: [{
        required: true, message: '请选择销毁时间'
      }]
    }, {
      "type": "textarea",
      "label": "备注",
      "prop": "remark",
      span: 24,
    }, ]
  }, ]
}
